package com.violet.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.violet.domain.po.Category;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    // 根据ID获取分类对象，添加悲观锁
    Category getByIdWithPessimisticLock(String id);

    // 根据ID获取分类对象，添加悲观锁，并且判断商品数量是否为0
    Category getByIdAndProductCountIsZeroWithPessimisticLock(String id);

}
